-
Notifications
You must be signed in to change notification settings - Fork 757
[cssom][all] Add CSSOMString and replace DOMString usage with it #1266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As resolved by CSS WG on 2017-04-19, because they are URLs. This is consistent with HTML: whatwg/html#1282
Implementations can choose one or the other. CSSWG resolution: w3c#1217 (comment)
|
|
||
| Or, alternatively: | ||
|
|
||
| <pre class="def lang-webidl"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use class="idl extract" here instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With that Bikeshed gives:
FATAL ERROR: Multiple local 'typedef' <dfn>s have the same linking text 'CSSOMString'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... @tabatkins should this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't added the "extract" support yet. (The bug is still open!)
(And in any case, I think it's probably better to do exactly this - instead of claiming something is WebIDL and then opting out, just ask it to be highlighted as WebIDL but otherwise be meaningless text.)
cssom/Overview.bs
Outdated
| This choice effectively allows implementations to do this replacement, | ||
| but does not require it. | ||
|
|
||
| This enables an implementation to use UTF-8 internally to represent strings in memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/This/Using {{USVString}}/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
cssom/Overview.bs
Outdated
|
|
||
| On the other hand, | ||
| implementations that internally represent strings as 16-bit <a>code units</a> | ||
| may prefer to avoid the cost of doing this replacement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use may in a note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with “might”.
|
(Thanks for fixing link errors in cssom!) |
I did hesitate about this one, it just seemed more “within style system territory”. I don’t feel strongly about it, though. In Stylo we can (and possibly already do) keep this on the C++ side rather than the Rust side of the bindings. (And Servo needs to decide what to do about every |
|
So I'm open to changing how this works, but since the string will exist as a |
|
Changed |
CSSWG resolution: w3c#1217 (comment) Fix w3c#1217. Each occurrence is one of: * CSS syntax * A name (for example a property name) that also occurs in CSS syntax * `Stylesheet::type`, which is always `text/css`. Not replaced: * `Stylesheet::title`, which is set from the eponymous HTML content attribute of [`<style>`](https://html.spec.whatwg.org/multipage/semantics.html#attr-style-title) and [`<link>`](https://html.spec.whatwg.org/multipage/semantics.html#attr-link-title) elements. These contant attributes are reflected as `HTMLElement::title` DOM attributes, where they are `DOMString`.
|
Filed web-platform-tests/wpt#5641 to follow up on tests. The |
CSSOMStringis an IDLtypedefof eitherUSVStringorDOMString, chosen by implementations.CSSWG resolution: #1217 (comment). Fixes #1217.
Each replaced occurrence is one of:
Stylesheet::type, which is alwaystext/css.Stylesheet::title, which is set from the eponymous HTML content attribute of<style>and<link>elements.